package com.chinasofti.manager.domain;

public class TestStudent3 {
    public static void main(String[] args) {
        Student stu1 = new Student();
        stu1.name="啊强";
        Student stu2 = stu1;//stu1地址赋给stu2
        stu2.name="啊珍";
        System.out.println(stu1.name+stu2.name);//相同
        stu1=null;//把stu1地址值设为null
//        System.out.println(stu1.name);
        System.out.println(stu2.name);//stu2找不到stu1
        //NullPointerException
    }
}
